package com.hx.pojo;

public class User {
    private  String name;
    private String pwd;
    public User(){
        System.out.println("我是无参构造，我让调用了");
    }
    public void login(){
        System.out.println("用户需要登录才能访问！");
    }

    public String getName() {
        return name;
    }

    public User(String name, String pwd) {
        this.name = name;
        this.pwd = pwd;
        System.out.println("我是全参构造，我被调用了");
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", pwd='" + pwd + '\'' +
                '}';
    }
}
